%----------------------------------------
% IT IS RECOMMENDED TO USE AUTOLATEX FOR
% COMPILING THIS DOCUMENT.
% http://www.arakhne.org/autolatex
%----------------------------------------

\documentclass[article,english,nodocumentinfo]{multiagentfrreport}

% The TeX code is entering with UTF8
% character encoding (Linux and MacOS standards)
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{../common/sarl-listing}

\graphicspath{{imgs/auto/},{imgs/},{../common/}}

\declaredocument{VI51 Lab Work \#2}{Individual Movement Algorithms}{UTBM-INFO-VI51-LW2}

\addauthorvalidator*[St\'ephane Galland]{St{\'e}phane}{Galland}{Teacher}

\updateversion{5.0}{\makedate{03}{05}{2015}}{First release on Github}{\upmpublic}

\Set{mafr_contact_name}{\phdname*{St\'ephane}{Galland}}
\Set{mafr_contact_email}{stephane.galland@utbm.fr}
\Set[french]{mafr_contact_phone}{03~84~58~34~18}
\Set[english]{mafr_contact_phone}{+33 384~583~418}

\gdef\skeletonName{\texttt{\mbox{LW2\_VI51\_skeleton\string.jar}}}

\begin{document}

\section{Goal of this Lab Work Session}

The goal of this lab work session is to write a set of movement algorithms for the simulation of pedestrian (rabbits).
The work should be done in the programming languages SARL (\url{http://www.sarl.io}) and Java.
You shall use code skeleton provided by the tearchers with the simulation framework already coded inside.

You shall learn: 
\begin{itemize}
\item How to write a general API for the movement algorithms (of type kinematic and steering).
\item How to extract information for the perception of an agent.
\item How to use a movement algorithm inside the behavior function of an agent.
\item How to influence the agent's environment with movement requests (aka. influences).
\end{itemize}

\input{../common/install}

\section{Brief Description of the Code Skeleton}

The skeleton contains a framework in the package \texttt{fr.utbm.info.vi51.framework}.
This framework contains the abstract implementation for the execution platform.
\emph{It is recommended to read this code and the associated Javadoc.}

The package \texttt{fr.utbm.info.vi51.labwork2} contains the code to complete during this lab work.

The subpackages are or will be:
\begin{itemize}
\item \texttt{fr.utbm.info.vi51.general.behavior} is the package in which you must create the behaviors (kinematic and/or steering).
\item \texttt{fr.utbm.info.vi51.labwork2.environment} contains the definition of the environment and the objects inside that are specific to the lab work.
\item \texttt{fr.utbm.info.vi51.labwork2.gui} contains the UI for the project.
\item \texttt{fr.utbm.info.vi51.labwork2.agent} contains the code of the agent to complete.
\item The file \texttt{fr/utbm/info/vi51/labwork2/MainProgram.java} contains the main program.
\end{itemize}

\section{Work to be Done during the Lab Work Session}

The following sections describe the work to be done during this lab work session.

\subsection{Kinematic Behavior}

Write the seek behavior in its kinematic version: the output of the behavior is a linear speed.
The principle of the seek behavior is to reach a targeting point as fast as possible (see Figure \figref{seek}, page \figpageref{seek}).

\mfigure[p]{width=.6\linewidth}{seek}{Seek Behavior, reach a target point as fast as possible}{seek}

\subsection{Sterring Behaviors}

\subsubsection{Seek Steering Behavior}

Write the seek behavior in its steering version: the output of the behavior is a linear acceleration.
The principle of the seek behavior is to reach a targeting point as fast as possible (see Figure \figref{seek}, page \figpageref{seek}).

\subsubsection{Align Steering Behavior}

Write the align behavior in its steering: the output of the behavior is an angular acceleration.
The principle of the align behavior is to turn the body for matching the body's direction to a targeted direction (see Figure \figref{align}, page \figpageref{align}).

\mfigure[p]{width=.6\linewidth}{align}{Align Behavior, align to a target direction as fast as possible}{align}

\subsubsection{Face Steering Behavior}

Write the face behavior in its steering version: the output of the behavior is an angular acceleration.
The principle of the face behavior is to turn the body for facing a point, i.e. the orientation of the body should point to the targeted point.
This behavior may delegate a part of its algorithm to the align steering behavior.

\subsubsection{Pursue Steering Behavior}

Write the pursue behavior in its steering version: the output of the behavior is a linear acceleration.
The principle of the pursue behavior is predict the next position of a target entity (see Figure \figref{pursue}, page \figpageref{pursue}).
This behavior may delegate a part of its algorithm to the seek steering behavior.

\mfigure[p]{width=.6\linewidth}{pursue}{Pursue Behavior, catch a target entity by predicting its next position}{pursue}

\subsubsection{Wandering Steering Behavior}

Write the wandering behavior in its steering version: the output of the behavior is a linear acceleration \emph{AND} an angular acceleration.
The principle of the wandering behavior is move and turn the body randomly.
For obtaining this result, a target point is computed on a virtual circle at the front of the entity (see Figure \figref{wander}, page \figpageref{wander}).
The entity is seeking this target point.

\mfigure[p]{width=.6\linewidth}{wander}{Wandering Behavior, move randomly}{wander}

\end{document}
